﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>宾果高校</title>
    <link rel="stylesheet" href="/static/css/angularStyle.css" />
    <link rel="stylesheet" href="/static/css/styles.css">
    <link rel="stylesheet" href="/static/css/swiper.min.css" />
    <link rel="stylesheet" href="/static/css/ng-pagination.min.css" />
    <link rel="stylesheet" href="/static/css/sweetalert.min.css" />
    <link rel="stylesheet" href="/static/js/simditor/styles/simditor.css" />
    <link rel="stylesheet" href="/static/js/simditor/styles/simditor-html.css" />
    <style>
        .association-logo {
            position: absolute;
            top: 24px;
            left: 0;
            width: 100%;
            text-align: center;
        }

            .association-logo img {
                display: inline-block;
                width: 118px;
                height: 118px;
                border-radius: 50%;
                overflow: hidden;
            }

        .ml10 {
            margin-left: 10px;
        }

        .released-invite {
            margin-bottom: 22px;
            font-size: 14px;
            color: #4c4c4c;
        }

        .campaignd-goods-company {
            margin: 10px 0;
        }

            .campaignd-goods-company li {
                width: 25%;
                float: left;
            }

                .campaignd-goods-company li.other {
                    width: 50%;
                }

                .campaignd-goods-company li label {
                    display: inline-block;
                }
    </style>
</head>
<body>
    <div id="divHeader"></div>
    <div class="main" ng-app="myApp" ng-controller="projectDetailCtrl">
        <div class="container pr" ng-model="names" ng-cloak>
            <div class="crumb">
                <ul class="clearfix"></ul>
            </div>
            <div class="article-header">
                <h2>{{names.ProjectName}}</h2>
                <div class="wrap bottom">
                    <div class="clearfix"><span class="fl">{{names.CreateDate | date:'yyyy-MM-dd HH:mm:ss'}}</span><!--<span class="fr">200人已浏览</span>--></div>
                </div>
            </div>
            <div style="margin-top: 40px;position:relative;" class="clearfix">
                <div class="released-module-l pr">
                    <div id="divFavorites"></div>
                    <div class="title">
                        <h2>基本信息</h2>
                    </div>
                    <div style="margin-top: 20px;">
                        <ul>
                            <li>活动状态： <span class="main-color">{{names.Status | projectStatus}}</span></li>
                            <li id="liDownload"><span>策划书： </span><a href="{{names.SponsorBook}}" class="main-color">点击下载</a></li>
                            <li id="liPerDownload"><span>策划书： </span><a href="/login.html" class="main-color">请登录后下载</a></li>
                            <!--<li class="{{names.CreatorType == 'Company' ? 'show' : 'hide' }}"><span>指定宣传用图：  </span><a href="javascript:void(0)" class="main-color">点击下载</a></li>-->
                            <li>活动类型： <span class="main-color">{{names.ActivityType}}</span></li>
                            <li>赞助金额： <span class="main-color">{{names.Amount}}元</span></li>
                            <li>活动规模： {{names.StudentInterval}}</li>
                            <li>活动地区： {{names.AreaDetails == '' ? '不限' : names.AreaDetails}}</li>
                            <li class="{{names.CreatorType == 'Student' ? 'show' : 'hide' }}">活动地点： {{names.Address}}</li>
                            <li>活动时间： {{names.StartDate | date:'yyyy年MM月dd日' }}-{{names.EndDate | date:'yyyy年MM月dd日'}}</li>
                            <li class="{{names.CreatorType == 'Student' ? 'show' : 'hide' }}">活动场次： {{names.ActivityNum}}</li>
                            <li>宣传方式： {{names.PublicizeType}}</li>
                            <li>执行团队： {{names.ExecutiveTeam}}</li>
                            <li id="liContactName">活动联系人姓名： {{names.ContactName}}</li>
                            <li id="liContactPhone">活动联系人电话： {{names.ContactPhone}}</li>
                            <li id="liPerContactName"><span>活动联系人姓名： </span><a href="/login.html" class="main-color">请登录后查看</a></li>
                            <li id="liPerContactPhone"><span>活动联系人电话： </span><a href="/login.html" class="main-color">请登录后查看</a></li>
                        </ul>
                    </div>
                    <div class="released-module marginRight">
                        <div class="title">
                            <h2 id="activityGoods">{{names.CreatorType == 'Company' ? '活动提供物资' : '活动所需物资' }}</h2>
                        </div>
                        <ul class="campaignd-goods-company clearfix">
                            <li class="{{names.CreatorType == 'Company' ? 'show' : 'hide' }}"><label for="">公司产品：</label><span>{{names.Product}}</span><span>箱</span></li>
                            <li><label for="">活动海报：</label><span>{{names.Poster}}</span><span>张</span></li>
                            <li><label for="">麦克风：</label><span>{{names.Microphone}}</span><span>个</span></li>
                            <li><label for="">活动音响：</label><span>{{names.Sound}}</span><span>个</span></li>
                            <li><label for="">活动帐篷：</label><span>{{names.Booth}}</span><span>顶</span></li>
                            <li class="{{names.CreatorType == 'Student' ? 'show' : 'hide' }}"><label for="">活动展位：</label><span>{{names.Poster}}</span><span>个</span></li>
                            <li><label for="">易拉宝：</label><span>{{names.Rollup}}</span><span>个</span></li>
                            <li><label for="">活动桌椅：</label><span>{{names.Desk}}</span><span>张</span></li>
                            <li><label for="">活动KT板：</label><span>{{names.KTBoard}}</span><span>张</span></li>
                            <li><label for="">活动传单：</label><span>{{names.Leaflet}}</span><span>张</span></li>
                            <li><label for="">活动横幅：</label><span>{{names.Banner}}</span><span>张</span></li>
                            <li style="width: 50%"><label for="">其它物料：</label><span>{{names.Other}}</span><span></span></li>
                        </ul>
                        <div class="title">
                            <h2>活动简介</h2>
                        </div>
                        <div class="article">
                            <p ng-bind-html="names.Introduction | to_trusted"></p>
                        </div>
                        <div class="title">
                            <h2 id="titleForType">{{names.CreatorType == 'Student' ? '活动效果承诺' : '活动效果要求' }} </h2><!-- <h1 id="promission" style="color:red" class="hide"></h1> -->
                        </div>
                        <div class="article article2">
                            <p>活动照片 {{names.Photos}} 张 活动视频 {{names.Video}} 条 活动推文 {{names.Tweets}} 篇   </p>
                            <p ng-bind-html="names.Supervision | to_trusted"></p>
                        </div>
                        <div class="submit text-center">
                            <button type="button" onclick="MakeEffective()" id="sureCom">确定合作</button>
                            <button type="button" ng-if="names.Status == 'Overdue'" class="up-hb-submit hbEdit">活动已过期</button>
                        </div>
                    </div>
                </div>
                <div class="released-carousel">
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                            <!-- <div class="swiper-slide"><img src="/static/images/carousel-sm1.jpg"></div>
                            <div class="swiper-slide"><img src="/static/images/carousel1.jpg" alt=""></div>
                            <div class="swiper-slide"><img src="/static/images/carousel-sm1.jpg" alt=""></div> -->
                            <div class="swiper-slide"><img src="{{names.ActImg1}}"></div>
                            <div class="swiper-slide"><img src="{{names.ActImg2}}" alt=""></div>
                            <div class="swiper-slide"><img src="{{names.ActImg3}}" alt=""></div>
                        </div>
                        <!-- <div class="swiper-pagination"></div> -->
                    </div>
                </div>
                <div class="released-module-r">
                    <div class="association pr">
                        <div class="association-logo"><img src="{{names.LogoPath}}" /></div>
                        <h2>{{names.Name}}</h2>
                    </div>
                    <div class="association-label">
                        <ul class="{{names.CreatorType == 'Student' ? 'ass-lab-student clearfix' : 'ass-lab-company clearfix' }}">
                            <li class="fl">{{names.CreatorType == 'Student' ? names.Nature : names.TypeDetail }}</li>
                            <li class="{{names.CreatorType == 'Student' ? 'show fr' : 'hide fr' }}">{{names.City}}</li>
                            <li class="{{names.CreatorType == 'Student' ? 'fl' : 'fr' }}">{{names.Scale}}</li>
                            <li class="{{names.CreatorType == 'Student' ? 'fr' : 'fl' }}">{{names.CreatorType == 'Student' ? names.TypeDetail : names.Nature }}</li>
                        </ul>
                    </div>
                    <div class="association-slogan">
                        <p>{{names.Remark}}</p>
                    </div>
                    <!--<div class="association-slogan">
                        <img src="static/images/communityDetail44.png" />
                    </div>-->
                </div>
            </div>
            <a id="backtop" class="back-top" href="javascript:window.scrollTo( 0, 0 );">
                <img src="/static/images/scrolltop.png" alt="">
                <p>回到顶部</p>
            </a>
            <div class="back-home">
                <a href="index.html">
                    <img src="/static/images/backhome.png" alt="">
                    <p>返回首页</p>
                </a>
            </div>
            <div class="contact-us">
                <img src="/static/images/contactus.png" alt="">
                <p>联系我们</p>
            </div>


            <div class="mask hide"></div>
            <div class="popBox uploadBox releaseUpBox hide" id="uploadBox">
                <h1 class="up-header">确认合作<a href="javascript:void(0)" class="up-hb-close" id="up-hb-close">X</a></h1>
                <div class="up-content">
                    <div class="up-h-book">
                        <h2 class="up-hb-h2">{{names.CreatorType == 'Company' ? '企业赞助信息' : '社团筹备信息' }}</h2>
                        <div class="up-hbook-content clearfix">
                            <p>
                                <label>活动名称：</label>
                                <span>{{names.ProjectName}}</span>
                            </p>
                            <p>
                                <label>{{names.CreatorType == 'Company' ? '提供赞助' : '所需赞助：' }}</label>
                                <span>{{names.Amount}}元</span>
                            </p>
                            <p>
                                <label>活动时间：</label>
                                <time>{{names.StartDate|date:'yyyy-MM-dd' }}至{{names.EndDate | date:'yyyy-MM-dd'}}</time>
                            </p>
                            <p>
                                <label>{{names.CreatorType == 'Company' ? '企业名称' : '社团名称：' }}</label>
                                <span>{{names.CreatorName}}</span>
                            </p>
                            <p class="{{names.CreatorType == 'Student' ? 'show' : 'hide' }}">
                                <label>活动地点：</label>
                                <time>{{names.Address}}</time>
                            </p>
                        </div>
                    </div>
                    <div class="up-h-book mt10">
                        <h2 class="up-hb-h3 pic">{{names.CreatorType == 'Company' ? '企业活动效果承诺' : '企业活动效果要求' }}<span>(提示:你所输入的内容，最终将会生成在合同中)</span></h2>
                        <div class="up-hbook-edit">
                            <p class="mb10 mt10">
                                <label class="">{{names.CreatorType == 'Company' ? '所需金额' : '赞助金额：' }}</label>
                                <input id="Amount" type="text" />
                                <span>元</span>
                            </p>
                            <p class="mb10 mt10 {{names.CreatorType == 'Student' ? 'show' : 'hide' }}">
                                <label class="">代理官编号：</label>
                                <input id="txtAgentID" type="text" />
                                <span class="txtAgentW">
                                    <label>代理官编号可在代理官信息中查看得知</label>
                                </span>
                            </p>
                            <textarea class="textPopBox" id="Feedback" height='200px' placeholder="请填写内容..."></textarea>

                        </div>
                    </div>
                    <button type="button" class="up-hb-submit hbEdit" id="up-hb-submit">发送邀请</button>
                </div>
            </div>
            <span class="hide" id="spanProjectID" tag="{{names.ProjectID}}"></span>
            <span class="hide" id="spanCreatorType" tag="{{names.CreatorType}}"></span>
        </div>
    </div>
    <div id="divFooter"></div>

    <!--弹窗-->
    <script type="text/javascript" src="/static/js/ref/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/store.min.js"></script>
    <script type="text/javascript" src="/static/js/self/common.js"></script>
    <script type="text/javascript" src="/static/js/ref/angular.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/sweetalert.min.js"></script>
    <script type="text/javascript" src="/static/js/ref/swiper.min.js"></script>
    <!--文字编辑器 -->
    <script type="text/javascript" src="/static/js/simditor/scripts/module.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/hotkeys.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/uploader.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/simditor.min.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/beautify-html.js"></script>
    <script type="text/javascript" src="/static/js/simditor/scripts/simditor-html.js"></script>
    <script>

        var userInfo = common.GetUser();
        var releaseUserType = common.checkValue(userInfo) ? $.parseJSON(userInfo).UserType : "";

        if (!common.checkValue(userInfo)) {
            $("#liDownload").hide();
            $("#liContactName").hide();
            $("#liContactPhone").hide();
        }
        else {
            $("#divHeader").load("/wuc/header.html");
            $("#liPerDownload").hide();
            $("#liPerContactName").hide();
            $("#liPerContactPhone").hide();
        }

        var param = common.getUrlArgStr();
        if (!common.checkValue(param.id))
            window.location = "/search.html";

        $("#divFooter").load("/wuc/footer.html");

        function AfterCompleted(ctx) {
            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }

            $("#uploadBox").hide();
            $(".mask").hide();
            window.location = "/index.html";
        }

        var app = angular.module('myApp', ['projectStatusFilters']);

        angular.module('projectStatusFilters', []).filter('projectStatus', function () {
            return function (input) {
                switch (input) {
                    case 'Overdue':
                        return "已过期";
                    case 'Rejected':
                        return "已拒绝";
                    case 'Cancel':
                        return "已取消";
                    case 'Closed':
                        return "已完成";
                    case 'Open':
                        return "赞助中"
                }
            };
        });

        function AfterLoading(ctx) {
            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }

            var createorType = ctx.ResponseDict.CreatorType;

            var userType = releaseUserType == 1 ? "Company" : releaseUserType == 2 ? "Student" : "";

            //if (userType == "Company") {
            //    $("#titleForType").html("活动效果要求");
            //}
            //else

            if (!common.checkValue(releaseUserType)) {
                $("#divHeader").load("/wuc/header.html", function () {
                    CheckUser(createorType == "Company" ? 1 : 2);
                });
            }

            //if (userType == "Student") {
            //    $("#promission").removeClass();
            //}

            if (createorType == userType || !common.checkValue(userType) || ctx.ResponseDict.Status == "Overdue")
                $("#sureCom").hide();

            if (createorType != userType && common.checkValue(userInfo))
                $("#divFavorites").load("/wuc/favorites.html", function () {
                    Init(param.id);
                });
        }

        common.CreateController({ name: 'projectDetailCtrl', url: '/api/project/get?id=' + param.id + '&type=Project', objType: 'dict', cacheName: 'Project', sMethod: AfterLoading, htmlFilter: true, app: app });

        //登录框下拉
        $('.link-login').on('click', function (e) {
            var self = $(this);
            self.parent().siblings().find('a').removeClass('on');
            self.toggleClass('on');
        });

        $("#up-hb-close").on('click', function (e) {
            $("#uploadBox").hide();
            $(".mask").hide();
        });

        function MakeEffective() {
            common.commonAjax({ type: 'Get', url: '/api/user/HasVerified', sMethod: AfterVerified });
        }

        function AfterVerified(ctx) {
            if (ctx == null) {
                common.alertMessage("无数据.");
                return;
            }

            if (ctx.ResponseDict.HasVerified == "Y") {
                $(".mask").show();
                $("#uploadBox").show();
            }
            else {
                common.showMessage(ctx.ResponseDict.Message, function () {
                    if (releaseUserType == 1)
                        window.location = "/company/register.html";
                    else
                        window.location = "/personal/register.html";
                })
            }
        }

        //关闭弹窗
        $("#up-hb-submit").on('click', function (e) {

            var values = {};
            values.Amount = $("#Amount").val();
            values.Feedback = editor.getValue();
            values.AgentID = $("#txtAgentID").val();
            values.ProjectID = $("#spanProjectID").attr("tag");

            common.commonAjax({ type: 'Post', url: '/api/project/CreateContract', data: values, sMethod: AfterCompleted, alert: true });

        });


        //打开弹窗
        //$("#sureCom").on('click', function (e) {
        //    $(".mask").show();
        //    $("#uploadBox").show();
        //});

        var editor = common.CreateEditor('Feedback');

        var mySwiper = new Swiper('.swiper-container', {
            direction: 'horizontal',
            loop: true,
            autoplay: 3000,
            simulateTouch: false,
            //pagination: '.swiper-pagination',
            autoplayDisableOnInteraction: false
            //- scrollbar: '.swiper-scrollbar',
        })

    </script>
</body>
</html>